local tr = aegisub.gettext
script_name = tr('ArialWords')
script_description = tr('change font family of words in chinese lines to arial.')
script_author = tr('WandWay')
script_version = '0.1'
script_last_update_time = '2015/03/04'

function arial_words(subtitles, selected_lines, active_line)
	for z, i in ipairs(selected_lines) do
		local l = subtitles[i]
		l.text = string.gsub(l.text, '([%a ]+)', '{\\fnArial}%1{\\r}')
		subtitles[i] = l
	end
	aegisub.set_undo_point(script_name)
end

aegisub.register_macro(script_name, script_description, arial_words)